package com.gs.cd.utils.jwt;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.*;

/**
 * create by hippo  2020/2/24
 *
 * @Description
 **/
@Data
public class JwtUserInfo implements Serializable {
    private static final long serialVersionUID = 8845570278974455159L;

    private String loginName;
    private Long userId;
    private String ssoUserId;
    private String ssoTicket;
    private String email;
    /**
     * 姓名
     */
    private String userName;

    public JwtUserInfo() {
        this.loginName = "";
        this.userId = -1L;
        this.ssoUserId = "";
    }

    public JwtUserInfo(String loginName, Long userId) {
        this.loginName = StrUtil.isBlank(loginName) ? "" : loginName;
        this.userId = userId == null ? 0L : userId;
        this.ssoUserId = "";
        this.userName = "";
        this.email = "";
    }

    public JwtUserInfo(String loginName, String userName, Long userId, String ssoUserId, String email) {
        this.loginName = StrUtil.isBlank(loginName) ? "" : loginName;
        this.userName = StrUtil.isBlank(userName) ? "" : userName;
        this.userId = userId == null ? 0L : userId;
        this.ssoUserId = StrUtil.isBlank(ssoUserId) ? "" : ssoUserId;
        this.email = StrUtil.isBlank(email) ? "" : email;
    }

}
